<meta charset="UTF-8"/>
<?php $bang = $this->cart->contents(); ?>
<div class="container">
    <div class="subpage_area">
        <div class="span-12 notopmargin">
            <h2 class="subpage_title colored" style="font-size: 18px;">Your shopping cart</h2>
            <p class="subpage_descr">: This is a custom page description.</p>
        </div>
        <div class="right">
            <form class="form-wrapper" action="">
                <input type="text" id="search" placeholder="Search for somtihing" required="">
                <input type="submit" value="Search" id="submit">
            </form>
        </div>
    </div>
    <div class="span-24 blog notopmargin yourcart">
        <?php
        if (count($bang) > 0) {
            ?>


            <table class="bordered" style="margin: 10px auto;width: 100%;">
                <tr>
                    <th>Mã sản phẩm</th>
                    <th>Tên sản phẩm</th>
                    <th>Đơn giá</th>
                    <th>Số lượng</th>
                    <th>Cập nhật</th>
                    <th>Delete</th>
                </tr>

                <?php
                foreach ($bang as $item) {
                    ?>
                    <tr class="row-cart" id="<?php echo $item['id']; ?>">
                        <td><a href="#"> <?= $item['id']; ?></a></td>
                        <td><?= $item['name']; ?></td>
                        <td><?= $item['price'] . ' VNĐ'; ?></td>
                        <td class='quantity'><input type="text" class="text-style qty" value="<?= $item['qty']; ?>"> <span class='add-up'>+</span> <span class='add-down'>-</span> </td>
                        <td><button>Update</button></td>
                        <td><button class="btn-delete">Delete</button></td>
                    </tr>
                <?php }
                ?>

            </table>
            <?php
            echo form_open('yourcart/checkout');
            echo form_submit("checkout", "Thanh toán");
            echo form_close();
            ?>
            


            <?php
        }
        else
        {
            
            ?>
        <div style="min-height: 300px;" >
            <h4>
                Chưa có sản phẩm nào trong giỏ hàng        
            </h4> 
        </div>
        <?php } ?>
    </div>
</div>